﻿@using CoralNode.Core.Entity.Enums
@using CoralNode.MvcClient.Helper
@using Coralcode.Utils.Basic
@model CoralNode.Core.Entity.Domains.Block.BlockDomain
@{
    ViewBag.Title = "Edit";
}
@Html.IncludePage("CoralAdmin/prototype", "_Left", new { current = "block" })
<div id="pbody">
    <div class="extra">
        <div class="pbody_top">
            <span class="ico ico_setting_system"></span><span class="t t_c">内容设计&nbsp;&nbsp;/&nbsp;&nbsp;<b
                class=" t_small f_no">添加内容块</b></span>
        </div>
        <div id="main">
            <div class="funsearch p_1 pl_2 pr_2 extra_normal border-bottom1">
                <a href="/m/prototype" class="ico ico_back btn f_r mt_0-5"></a>
            </div>
            <form id="spform" action="/m/prototype/createBlock" method="post" enctype="multipart/form-data">
                @if (@ViewBag.Msg != null) {
                    <div class="error_msg">
                        @ViewBag.Msg.Msg
                    </div>
                }
                <div class="pt_1 slideswitch pl_2 pr_2" data-js="slideswitch">
                    <div class="switch_tab">
                        <span class="btn"><i class="ico ico_slideswitch_show"></i></span>主要信息
                    </div>
                    <div class="table_form form_main switch_cnt">
                        <div class="pl_2">
                            <table>
                                <tbody>
                                    <tr>
                                        <th width="80">内容块名称<span class="rq">*</span></th>
                                        <td>
                                            @Html.TextBoxFor(m => m.Title, new { @class = "text w_37 required" })
                                        </td>
                                    </tr>
                                     <tr>
                                        <th width="80">内容块代码<span class="rq">*</span></th>
                                        <td>
                                            @Html.TextBoxFor(m => m.BlockKey, new { @class = "text w_37 required" })
                                        </td>
                                    </tr>
                                    <tr>
                                        <th width="80">分组<span class="rq">*</span></th>
                                        <td>
                                            <div class="select_owner w_12-5 " data-meta="{value:'@ViewBag.GroupId',name:'GroupId', btn:'<span class=\'ico ico_slide_down\'></span>' , clickbtn:'<span class=\'ico ico_slide_up\'></span>'}">
                                                <ul>
                                                    @foreach (var item in @ViewBag.GroupList) {
                                                        if (@item.Id == @ViewBag.GroupId) {
                                                        <li data-value="@item.Id">@item.Title
                                                        </li>
                                                        } else {
                                                        <li data-value="@item.Id">@item.Title
                                                        </li>
                                                        }
                                                    }
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>类型</th>
                                        <td>
                                            <div class="select_owner w_20 " data-meta="{name:'Type',value:'1',fun:'selectPrototype', btn:'<span class=\'ico ico_slide_down\'></span>' , clickbtn:'<span class=\'ico ico_slide_up\'></span>'}">
                                                <ul>
                                                    @foreach (var item in ViewBag.BlockTypeList) {
                                                        if (Model.Type == @item.Value) {
                                                        <li data-value="@item.Value">@item.Key
                                                        </li>
                                                        } else {
                                                        <li data-value="@item.Value">@item.Key
                                                        </li>
                                                        }
                                                    }
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="submitbox p_2 extra_normal">
                    <input type="submit" class="btn_1" value="提    交" />
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.nav_left_style2').find('li').eq(4).addClass('current');
    });
</script>
